<?php
class Training_RegistryController extends Zendvn_Controller_Action{
	
	public function init(){
		parent::init();
		echo '<br>' . __METHOD__;
		echo '<br>' . Zend_Registry::get('str');
		
	}
	
	public function preDispatch()
    {
    	echo '<br>' . __METHOD__;
		echo '<br>' . Zend_Registry::get('str');
		
    }
	
	public function postDispatch()
    {
    	echo '<br>' . __METHOD__;
		echo '<br>' . Zend_Registry::get('str');
		echo '<br>' . Zend_Registry::get('abc');
		if(Zend_Registry::isRegistered('index')){
			echo '<br>' . Zend_Registry::get('index');
		}
		if(Zend_Registry::isRegistered('index2')){
			echo '<br>' . Zend_Registry::get('index2');
		}
		/*echo '<pre>';
		print_r($registry);
		echo '</pre>';*/
    }
    
	public function indexAction(){
		echo '<br>' . __METHOD__;
		echo '<br>' . Zend_Registry::get('str');
		Zend_Registry::set('abc','This is a string');
		$registry = Zend_Registry::getInstance();
		//Zend_Registry::set(array('index'=>'value','index2'=>'value2'));
		
		
	}
	
	public function index2Action(){
		echo '<br>' . __METHOD__;
		echo '<br>' . Zend_Registry::get('str');
		$this->_helper->viewRenderer->setNoRender();
		
	}
}